﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraEditors;
using DevExpress.Utils;
using System.Drawing;

namespace ProgNetComponentsDx.Controls
{
    public class AutoSizeGroupControl : GroupControl
    {
        public override Size GetPreferredSize(Size proposedSize)
        {
            Size s = base.GetPreferredSize(proposedSize);
            if (this.ShowCaption && (this.CaptionLocation == Locations.Default || CaptionLocation == Locations.Top))
                s.Height -= ViewInfo.CaptionBounds.Height;
            return s;
        }
    }
}
